package cn.com.fssg.platform.base.handler;

import cn.com.fssg.platform.modules.workflow.entity.ActexHiTaskLog;
import cn.com.fssg.platform.modules.workflow.vo.TaskVO;

import java.util.List;

public interface ProcInstHandler {

    /**
     * 流程作废前
     *
     * @param procInstanceId 流程实例id
     * @param businessKey 业务主键
     * @param currentTaskVOs 当前现存的任务
     * @return
     */
    boolean beforeCancelProcInst(String procInstanceId,String businessKey,List<TaskVO> currentTaskVOs);

    /**
     * 流程作废后
     * @param procInstanceId 流程实例id
     * @param businessKey 业务主键
     * @return
     */
    boolean afterCancelProcInst(String procInstanceId,String businessKey);


    /**
     * 删除流程前
     * @param procInstanceId 流程实例id
     * @param businessKey 业务主键
     * @return
     */
    boolean beforeDeleteProInst(String procInstanceId,String businessKey);

    /**
     * 删除流程后
     * @param procInstanceId 流程实例id
     * @param businessKey 业务主键
     * @return
     */
    boolean afterDeleteProInst(String procInstanceId,String businessKey);


    /**
     * 任务取回前
     *
     * @param procInstanceId 流程实例id
     * @param businessKey 业务主键
     * @param needDelLogs 被取回的任务（扩展的任务日志表）
     * @return
     */
    boolean beforeRetrieve(String procInstanceId,String businessKey,List<ActexHiTaskLog> needDelLogs);

    /**
     * 任务取回后
     * @param procInstanceId 流程实例id
     * @param businessKey 业务主键
     * @param newTaskVOs 取回后新的任务
     * @return
     */
    boolean afterRetrieve(String procInstanceId,String businessKey,List<TaskVO> newTaskVOs);



}
